import {request, uploadFile} from '@/util/request.js'

//登录
export const login = data => request({url: 'login', method: 'POST', data: data, needAuth: '0'});

//获取个人信息
export const queryUserInfo = data => request({url: 'getInfo'});

//获取验证码
export const getCaptchaImage = data => request({url: 'captchaImage', needAuth: '0'});

//周边广告点位信息
export const queryNearbyMedia = data => request({url: 'sys/outdoor/mediaBase', method: 'POST', data: data});

//周边广告点位信息2分页
export const queryNearbyMedia2 = data => request({url: 'sys/outdoor/mediaBaseList', method: 'POST', data: data});

//地图上点击点位展示的详细信息  
export const getMediaDetailByMap = data => request({url: 'sys/outdoor/onClick', method: 'POST', data: data});

//新增案件上报
export const createReportBase = data => request({url: 'sys/outdoor/addReportBase', method: 'POST', data: data});

//图片上传
export const uploadPic = data => uploadFile({url: 'system/user/profile/picture', tempFilePath: data.tempFilePath, data: {}, name: 'avatarfile'});

//头像上传 
export const uploadHead = data => uploadFile({url: 'system/user/profile/avatar', tempFilePath: data.tempFilePath, data: {}, name: 'avatarfile'});

//案件图片上传
export const uploadReport = data => uploadFile({url: 'system/user/profile/report', tempFilePath: data.tempFilePath, data: {}, name: 'avatarfile'});

//字典
export const getDicts = data => request({url: `sys/outdoor/${data.type}`});

//上报媒体数
export const queryReportBaseNmnb = data => request({url: 'sys/outdoor/reportBaseNmnb',data: data, method: 'POST'});

//巡检记录
export const queryInspectionRecord = data => request({url:'sys/outdoor/countMedia', data: data, method: 'POST'});

//巡检问题详情
export const queryInspectionDetails = data => request({url:'sys/outdoor/reportBaseDetails', data: data, method: 'POST'});

//新增媒体
export const createMedia = data => request({url: 'sys/outdoor/addExamination', data: data, method: 'POST'});

//编辑媒体
export const updateMedia = data => request({url: 'sys/outdoor/updateMedia', data: data, method: 'POST'});

//问题上报处置数量
export const queryDisposeCaseNum = data => request({url: 'sys/outdoor/selectReportBaseNumb', data: data, method: 'POST'});

//问题上报处置列表
export const queryDisposeCase = data => request({url: 'sys/outdoor/selectReportBase', data: data, method: 'POST'});

//新增问题上报
export const createReport = data => request({url: 'sys/outdoor/addReportBase', data: data, method: 'POST'});

//获取app版本
export const queryAppVersion = data => request({url: 'sys/outdoor/appVersion', data: data, method: 'POST'});


//媒体类别
export const getMediaType = data => request({url: 'media/query/recent/getMediaType', data});